export interface ResponseType<T> {
	data : T;
	status : number;
	errmsg : string | null;
}
export default class Response<T>{
	private data : ResponseType<T>
	constructor() {
		this.data = {
			status: 200,
			data: null,
			errmsg: null,
		}
	}
	public setStatus(value : number) {
		this.data.status = value;
		return this;
	}
	public setData(value : T) {
		this.data.data = value;
		return this;
	}
	public setErrmsg(value : string) {
		this.data.errmsg = value;
		return this;
	}
	public toJSON() {
		return this.data;
	}
}